package com.jk.controller;

import com.jk.utils.OssUpFileUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;

/**
 * @Description: 骚骚的🐏
 * @Author: 杨
 * @Date: 2019/3/16 20:36
 */
@Controller
@RequestMapping("img")
public class imgController {
    @ResponseBody
    @RequestMapping("addFile")
    public String addFile(MultipartFile file){
        Map<String, Object> stringObjectMap = OssUpFileUtil.uploadFile(file);
        String count = "";
        for(String key : stringObjectMap.keySet()){
            Object o = stringObjectMap.get(key);
            System.out.println("key: " + key + " value: " + o);

            if(key=="url"){

                count+=o;

            }
        }
        return count;
    }




}
